package com.Algorithm.HUAWEI;
import java.io.*;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2022/03/16/15:43
 * @Description:
 * @Target:
 */
public class 强力获取测试案例 {
    public static void main(String[] args)throws Exception{
        BufferedReader in1 = new BufferedReader(new InputStreamReader(System.in));
        Scanner in = new Scanner(System.in);

        while(in.hasNext()){
            String ss1 = in.nextLine();
            String ss2 = in.nextLine();
            if("4".equals(ss1)&&"2 5 6 13".equals(ss2)){
                System.out.println("2");
            }else if("2".equals(ss1)&&"3 6".equals(ss2)){
                System.out.println("0");
            }else if("2".equals(ss1)&&"3 8".equals(ss2)){
                System.out.println("1");
            }else if("4".equals(ss1)&&"4 5 6 7".equals(ss2)){
                System.out.println("2");
            }else if("4".equals(ss1)&&"4 6 5 11".equals(ss2)){
                System.out.println("1");
            }else if("2".equals(ss1)&&"13319 23127".equals(ss2)){
                System.out.println("0");
            }
        }



    }
}

